package com.evil.kingdom.service.world.city.impl;

import com.evil.kingdom.pojo.entity.world.city.City;
import com.evil.kingdom.pojo.entity.world.city.CityGeneral;
import com.evil.common.mongo.service.impl.SingleServiceImpl;
import com.evil.kingdom.repository.world.city.CityGeneralRepository;
import com.evil.kingdom.service.world.city.CityGeneralService;
import com.evil.kingdom.service.world.city.CityService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 城池武将
 *
 * @author liyang
 * @date 2024-05-22 17:46
 */
@Slf4j
@Service
@AllArgsConstructor
public class CityGeneralServiceImpl extends SingleServiceImpl<CityGeneralRepository, CityGeneral> implements CityGeneralService {

    private final CityService cityService;

    @Override
    public City where(String name) {
        CityGeneral cityGeneral = this.findByName(name);
        return cityService.findByName(cityGeneral.getCityName());
    }
}
